-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
missed an IE mention / centering using margin #34174
Conversation
Preview URLs (comment last updated: 2024-06-20 18:46:58) |
files/en-us/web/css/margin/index.md
Outdated
|
||
However, in older browsers like IE8-9 that do not support Flexible Box Layout, these are not available. In order to center an element inside its parent, use `margin: 0 auto;`. | ||
More commonly, though, people horizontally center element by setting {{cssxref("display")}}`: flex;` {{cssxref("justify-content")}}`: center;` on a container, which [centers its flex item](/en-US/docs/Web/CSS/CSS_flexible_box_layout/Aligning_items_in_a_flex_container) children. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- How about the phrasing below (we can drop "to center an element horizontally" to avoid it repetition from the previous para)
- The quotes after the cssxref are adding an extra space before the ":". We can either remove the cssxref or link the entire property value pair.
More commonly, though, people horizontally center element by setting {{cssxref("display")}}`: flex;` {{cssxref("justify-content")}}`: center;` on a container, which [centers its flex item](/en-US/docs/Web/CSS/CSS_flexible_box_layout/Aligning_items_in_a_flex_container) children. | |
A more common method to center an element horizontally is by setting `display: flex;` and `justify-content: center;` on a container, which [centers its flex item](/en-US/docs/Web/CSS/CSS_flexible_box_layout/Aligning_items_in_a_flex_container) children. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used your suggestion, and linked justify-content
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
No description provided.